﻿using System;
using Microsoft.Xna.Framework;
using Terraria.DataStructures;
using Terraria.World.Generation;

namespace Terraria.GameContent.Generation
{
	// Token: 0x02000431 RID: 1073
	public class ActionPlaceStatue : GenAction
	{
		// Token: 0x0600251D RID: 9501 RVA: 0x0001A1FD File Offset: 0x000183FD
		public ActionPlaceStatue(int index = -1)
		{
			this._statueIndex = index;
		}

		// Token: 0x0600251E RID: 9502 RVA: 0x00483EE0 File Offset: 0x004820E0
		public override bool Apply(Point origin, int x, int y, params object[] args)
		{
			Point16 point;
			if (this._statueIndex == -1)
			{
				point = WorldGen.statueList[GenBase._random.Next(2, WorldGen.statueList.Length)];
			}
			else
			{
				point = WorldGen.statueList[this._statueIndex];
			}
			WorldGen.PlaceTile(x, y, (int)point.X, true, false, -1, (int)point.Y);
			return base.UnitApply(origin, x, y, args);
		}

		// Token: 0x04004110 RID: 16656
		private int _statueIndex;
	}
}
